<?php
/**
 * Author: Zheng_Great
 * Date: 2018-12-13 10:39:10
 * Description: 客户表
 */

namespace frontend\models;

use yii\db\ActiveRecord;
use yii\base\Model;

class Customer extends ActiveRecord{

 /**
  * description: 查询该用户所有订单
  * param {null} 
  * return: array
  */

 public function getOrders(){
		$orders=$this->hasMany(Order::className(),['customer_id'=>'id'])->asarray()->all();
		return $orders;
	}
}

 ?>